﻿using UnityEngine;
/// <summary>
/// returns inputs from unity
/// </summary>
class InputImplementation : IInputService
{
    public bool UpKeyHeld
    {
        get
        {
            if (Input.GetKey(KeyCode.UpArrow) || Input.GetKey(KeyCode.W))
                return true;
            else return false;
          
        }
    }
    public bool DownKeyHeld
    {
        get
        {
            if (Input.GetKey(KeyCode.DownArrow) || Input.GetKey(KeyCode.S))
                return true;
            else return false;
        }
    }
    public bool LeftKeyHeld
    {
        get
        {
            if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A))
                return true;
            else return false;
        }
    }
    public bool RightKeyHeld
    {
        get
        {
            if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D))
                return true;
            else return false;
        }
    }

    public bool UPkeyReleased
    {
        get
        {
            if (Input.GetKeyUp(KeyCode.UpArrow) || Input.GetKeyUp(KeyCode.W))
                return true;
            else return false;
        }
    }

    public bool DownkeyReleased
    {
        get
        {
            if (Input.GetKeyUp(KeyCode.DownArrow) || Input.GetKeyUp(KeyCode.S))
                return true;
            else return false;
        }
    }

    public bool RightkeyReleased
    {
        get
        {
            if (Input.GetKeyUp(KeyCode.RightArrow) || Input.GetKeyUp(KeyCode.D))
                return true;
            else return false;
        }
    }

    public bool LeftkeyReleased
    {
        get
        {
            if (Input.GetKeyUp(KeyCode.LeftArrow) || Input.GetKeyUp(KeyCode.A))
                return true;
            else return false;
        }
    }

    public bool MousePressed
    {
        get
        {
            return Input.GetMouseButtonDown(0);
        }
    }

    public bool MouseReleased
    {
        get
        {
            return Input.GetMouseButtonUp(0);
        }
    }

    public bool LeftShiftPressed
    {
        get
        {
            return Input.GetKeyDown(KeyCode.LeftShift);
        }
    }
}

